package org.martin.snsrs.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import org.springframework.security.core.codec.Hex;

public class MathUtil {
	public static String getMD5(String str){
		MessageDigest digest = null;
		try {
			digest = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		byte[] buffer = digest.digest(str.getBytes());
		String pass = new String(Hex.encode(buffer));
		return pass;
	}
}
